package com.service.device;

import com.dao.secondary.device.DeviceObdDayInfoMapper;
import com.github.pagehelper.PageHelper;
import com.model.domain.device.GetDeviceObdDayInfoDO;
import com.model.pojo.device.DeviceObdDayInfo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * @Author: zql
 * @Description: PCB每日轨迹统计服务
 * @Data: 2023-05-22
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class DeviceObdDayInfoService {

    private  final DeviceObdDayInfoMapper deviceObdDayInfoMapper;

    /**
     * 查询所有
     * @author tm
     * @date 2023-05-22 0:34
     * @param getDeviceObdDayInfoDO
     * @return List<DeviceObdDayInfo>
     */
    public List<DeviceObdDayInfo> getAll(GetDeviceObdDayInfoDO getDeviceObdDayInfoDO){
        PageHelper.clearPage();
        PageHelper.orderBy(getDeviceObdDayInfoDO.getSortRow() + getDeviceObdDayInfoDO.getSortOrder());
        return deviceObdDayInfoMapper.selectList(getDeviceObdDayInfoDO);
    }

    public void saveList(List<DeviceObdDayInfo> dayList){
         deviceObdDayInfoMapper.insertListSelective( dayList);
    }
}
